import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/smart_warehouse/product_storage_d_t_o_entity.dart';

ProductStorageDTOEntity $ProductStorageDTOEntityFromJson(Map<String, dynamic> json) {
  final ProductStorageDTOEntity productStorageDTOEntity = ProductStorageDTOEntity();
  final int? inventory = jsonConvert.convert<int>(json['inventory']);
  if (inventory != null) {
    productStorageDTOEntity.inventory = inventory;
  }
  final String? productId = jsonConvert.convert<String>(json['productId']);
  if (productId != null) {
    productStorageDTOEntity.productId = productId;
  }
  final String? productName = jsonConvert.convert<String>(json['productName']);
  if (productName != null) {
    productStorageDTOEntity.productName = productName;
  }
  final String? warehouseId = jsonConvert.convert<String>(json['warehouseId']);
  if (warehouseId != null) {
    productStorageDTOEntity.warehouseId = warehouseId;
  }
  return productStorageDTOEntity;
}

Map<String, dynamic> $ProductStorageDTOEntityToJson(ProductStorageDTOEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['inventory'] = entity.inventory;
  data['productId'] = entity.productId;
  data['productName'] = entity.productName;
  data['warehouseId'] = entity.warehouseId;
  return data;
}

extension ProductStorageDTOEntityExtension on ProductStorageDTOEntity {
  ProductStorageDTOEntity copyWith({
    int? inventory,
    String? productId,
    String? productName,
    String? warehouseId,
  }) {
    return ProductStorageDTOEntity()
      ..inventory = inventory ?? this.inventory
      ..productId = productId ?? this.productId
      ..productName = productName ?? this.productName
      ..warehouseId = warehouseId ?? this.warehouseId;
  }
}
